package com.mail.pojo;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;


@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain=true)
@TableName("email_templates")
public class EmailTemplates implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private long userId;

    private String emailTitle;

    private String emailContent;

    private Integer personOrTeam;

    private Long teamId;

    //创建时间
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    //更新时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    //创建人
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;


    //修改人
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    public EmailTemplates(Long id, long userId, String emailTitle, String emailContent, Integer personOrTeam, Long teamId) {
        this.id = id;
        this.userId = userId;
        this.emailTitle = emailTitle;
        this.emailContent = emailContent;
        this.personOrTeam = personOrTeam;
        this.teamId = teamId;
    }

    public EmailTemplates(long userId, String emailTitle, String emailContent, Integer personOrTeam, Long teamId) {
        this.userId = userId;
        this.emailTitle = emailTitle;
        this.emailContent = emailContent;
        this.personOrTeam = personOrTeam;
        this.teamId = teamId;
    }

    public EmailTemplates(long userId, String emailTitle, String emailContent, Integer personOrTeam) {
        this.userId = userId;
        this.emailTitle = emailTitle;
        this.emailContent = emailContent;
        this.personOrTeam = personOrTeam;
    }
}
